import { post } from '@/utils/request'

// 优惠券列表
export const getCouponList = async (params) => {
  return await post(`/api/admin/coupon/get_coupon_list?page_size=${params.page_size}&page_num=${params.page_num}`, params)
}

// 创建用户
export const createCoupon = async (params) => {
  return await post('/api/admin/coupon/create', params)
}

// 创建用户
export const updateCouponStatus = async (params) => {
  return await post('/api/admin/coupon/update_coupon_enable', params)
}

// 优惠券 使用记录
export const getRecordList = async (params) => {
  return await post(`/api/admin/coupon/get_coupon_use_log?page_size=${params.page_size}&page_num=${params.page_num}`, params)
}

// C端 积分列表
export const getUserScoreList = async (params) => {
  return await post(`/api/admin/score/get_user_score_list?page_size=${params.page_size}&page_num=${params.page_num}`, params)
}

// C端 积分列表
export const getAdminUserScoreList = async (params) => {
  return await post(`/api/admin/score/get_admin_user_score_list?page_size=${params.page_size}&page_num=${params.page_num}`, params)
}

// 添加积分
export const addUserScore = async (params) => {
  return await post('/api/admin/score/add_user_score', params)
}

// C端 积分列表
export const getUserWithdrawList = async (params) => {
  return await post(`/api/admin/score/get_user_score_withdraw_list?page_size=${params.page_size}&page_num=${params.page_num}`, params)
}

// 修改积分提现状态
export const updateWithdrawStatus = async (params) => {
  return await post('/api/admin/score/update_user_score_withdraw_status', params)
}

// 发放优惠券
export const sendUserCoupon = async (params) => {
  return await post('/api/admin/coupon/send_user_coupon', params)
}
